package com.neuedu.controller;


import com.neuedu.pojo.Result;
import com.neuedu.pojo.TElder;
import com.neuedu.pojo.TNursing;
import com.neuedu.service.ITNursingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangsan
 * @since 2024-06-17
 */
@RestController
@RequestMapping("/t-nursing")
public class TNursingController {
    @Autowired
    ITNursingService nursingService;
    @GetMapping("/findwitheld")
    public Result<List<TNursing>> findWithEld ( long eldId,String eldName,LocalDateTime nursingTimes){
        return nursingService.findWithEld(eldId, eldName ,nursingTimes);
    }
    /**
     *查找所有护理信息
     */

    @GetMapping("/findall")
    public Result<List<TNursing>> findAll (){
        return nursingService.findAll();
    }
    /**
     * 按老人Id查询护理信息
     */
    @GetMapping("/findbyeld/{eldId}")
    public Result<List<TNursing>> findByEld (@PathVariable("eldId")Long eldid, String nursingType){
        return nursingService.findByEld(eldid, nursingType);
    }
}
